From: Rui Matos Date: Mon, 30 Jan 2017 12:29:13 +0000 (+0100) Subject: background: Disconnect from 'prepare-for-sleep' signal X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~578 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b1dcea7cf1923bff49584751118fc8cf33f659a2;p=gnome-shell.git background: Disconnect from 'prepare-for-sleep' signal This signal connection was keeping Background instances from being garbage collected. https://bugzilla.gnome.org/show_bug.cgi?id=777934 --- diff --git a/js/ui/background.js b/js/ui/background.js index 9b3602964..fc2789810 100644 --- a/js/ui/background.js +++ b/js/ui/background.js @@ -254,7 +254,8 @@ const Background = new Lang.Class({ this._loadAnimation(this._animation.file); })); - LoginManager.getLoginManager().connect('prepare-for-sleep', + let loginManager = LoginManager.getLoginManager(); + this._prepareForSleepId = loginManager.connect('prepare-for-sleep', (lm, aboutToSuspend) => { if (aboutToSuspend) return; @@ -283,6 +284,10 @@ const Background = new Lang.Class({ this._clock.disconnect(this._timezoneChangedId); this._timezoneChangedId = 0; + if (this._prepareForSleepId != 0) + LoginManager.getLoginManager().disconnect(this._prepareForSleepId); + this._prepareForSleepId = 0; + if (this._settingsChangedSignalId != 0) this._settings.disconnect(this._settingsChangedSignalId); this._settingsChangedSignalId = 0;